cmake_minimum_required(VERSION 3.22)
project(Sofa.Component.Constraint.Lagrangian LANGUAGES CXX)

set(SOFACOMPONENTCONSTRAINTLAGRANGIAN_SOURCE_DIR "src/sofa/component/constraint/lagrangian")

sofa_add_subdirectory_modules(SOFACOMPONENTCONSTRAINTLAGRANGIAN_TARGETS
    DIRECTORIES Model Correction Solver
)

set(HEADER_FILES
    ${SOFACOMPONENTCONSTRAINTLAGRANGIAN_SOURCE_DIR}/config.h.in
    ${SOFACOMPONENTCONSTRAINTLAGRANGIAN_SOURCE_DIR}/init.h
)

set(SOURCE_FILES
    ${SOFACOMPONENTCONSTRAINTLAGRANGIAN_SOURCE_DIR}/init.cpp
)

add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC ${SOFACOMPONENTCONSTRAINTLAGRANGIAN_TARGETS})

sofa_create_package_with_targets(
    PACKAGE_NAME ${PROJECT_NAME}
    PACKAGE_VERSION ${Sofa_VERSION}
    TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
    INCLUDE_SOURCE_DIR "src"
    INCLUDE_INSTALL_DIR "${PROJECT_NAME}"
)
